<!DOCTYPE html>
<html>
<head>
    <title>DOM Level 2 CreateHTMLDocument Example</title>
</head>
<body>
    <script type="text/javascript">
       
        var htmldoc = document.implementation.createHTMLDocument("New Doc");
        alert(htmldoc.title);
        alert(typeof htmldoc.body);
    </script>
</body>
</html>